package org.zlpt.entity.co;

import lombok.Data;
import org.hyperledger.fabric.contract.annotation.DataType;
import org.hyperledger.fabric.contract.annotation.Property;
import org.zlpt.entity.enums.DriverType;
import org.zlpt.entity.enums.PayerType;

import java.math.BigDecimal;
import java.util.Date;

@Data
@DataType
public final class FapiaoCO {
    // 发票

    public static final String keyPrefiex = "bms_fapiao:";

    // 发票id
    @Property()
    private Long fapiaoId;
    // 发票编号
    @Property()
    private String fapiaoNumber;
    // 订单id
    @Property
    private Long orderId;
    // 支付流水id
    @Property
    private Long payRecordId;
    // 发票文件url
    private String fapiaoFileUrl;
    // 发票内容
    @Property
    private String fapiaoContent;
    // 发票金额
    @Property
    private BigDecimal fapiaoMoney;
    // 出租方抬头id
    @Property
    private Long lessorTitleId;
    // 承租方抬头id
    @Property
    private Long lesseeTitleId;
    // 开票方式
    @Property
    private Integer fapiaoWayGet;
    // 发票文件类型
    private String fapiaoFileType;
    // 发票状态
    @Property
    private String fapiaoStatus;
    // ocr识别结果
    @Property
    private FapiaoOcrCO ocrData;
    // 创建人id
    @Property
    private Long createBy;
    // 创建时间
    @Property
    private Date createTime;

    @Property
    private FapiaoVerificationV1 fapiaoVerification;

    @Property
    private FapiaoOcrCO fapiaoOcrCO;

    @Property
    private DriverType driverType;

    @Property
    private PayerType payerType;

    public String formKey() {
        return keyPrefiex + fapiaoId;
    }
    public static String formKey(Long userId) {
        return keyPrefiex + userId;
    }
}